<script>
	var dogetnopw='__URL__/dogetnopw';
  var dogetnopwbyalipaynoandqqno='__URL__/dogetnopwbyalipaynoandqqno'
  var qybscstwenxintishi="{$qybscsto['qybscstwenxintishi']}"
</script>
<!--table部分-->
<div class='col-md-12' style='padding-top:30px'>
  <div class="col-md-8">
    <div class="panel panel-success">
      <div class="panel-heading">公告</div>
      <div class="panel-body">
        {$qybscsto['qybscstgonggao']}
      </div>
    </div>

  </div>
	
	<div  class='col-md-4'>
    <div class="panel panel-success">
      <div class="panel-heading">提取帐号密码</div>
      <div class="panel-body">
        <div class="form-group">
          <label for="alipayno">提取类型</label>
          <select class="form-control" id="typeid">
            <?php if(count($typels)>1){ ?><option value='0'>请选择套餐</option><?php } ?>
            <volist name='typels' id='typev'>
              <option value='{$typev[typeid]}'>{$typev[typenm]}</option>
            </volist>
          </select>
        </div>
        <div class="form-group">
          <label for="alipayno">支付宝交易号</label>
          <input type="text" class="form-control" id="alipayno" placeholder="请输入 支付宝交易号">
        </div>
        <div class="form-group">
          <label for="qqno">QQ号</label>
          <input type="text" class="form-control" id="qqno" placeholder="请输入您自己现在主要用的QQ号，方便以后找回账号和密码">
        </div>
        <button class="btn btn-success" id='getnopw'>提取帐号密码</button>
      </div>
      
    </div>

    <div id='jieguoI' class="jieguo">
      
    </div>

    <div class="panel panel-success">
      <div class="panel-heading">忘记帐号密码</div>
      <div class="panel-body">
        
        <div class="form-group">
          <!--<label for="exampleInputName2">Name</label>-->
          <input type="text" class="form-control" id="alipaynoII" placeholder="请输入 支付宝交易号">
        </div>
        <div class='form-group'>
          <input type="text" class="form-control" id="qqnoII" placeholder="请输入 QQ号">
        </div>
        <button type="submit" class="btn btn-default" id='getnopwbyalipaynoandqqno'>忘记了？找回帐号密码</button>
        
      </div>
    </div>
		
    
		<div id='jieguoII' class="jieguo">
			
		</div>
	</div>
	

</div>

<script type="text/javascript">
$(function(){
	$('#getnopw').click(function(){ 

      if($('#typeid').val()==0){
        msg("请选择套餐！");return;
      }
		
      
      var obj=new Object();
      var typeid=$('#typeid').val();
      var alipayno=$.trim($('#alipayno').val());
      var qqno=$.trim($('#qqno').val());

      if(alipayno==''){alert('支付宝交易号不能为空！');return;}
      if(qqno==''){alert('QQ号不能为空！');return;}

      $('#jieguo').html('');
      $('#loading').trigger('click');
      obj['typeid']=typeid;
      obj['alipayno']=alipayno;
      obj['qqno']=qqno;

      $('.jieguo').html('');

      $.ajax({
          'type': 'GET',
          'url':dogetnopw,
          'async':false,  
          'contentType': 'application/json',
          'data': obj,
          'dataType': 'json',
          'success': function(data) {
            $('#loading_cancel').trigger('click');
          	var rslt=data['rslt'];
          	if(rslt==0){
          		msg(data['typenm']+'已经派完，请联系管理员！');return;
          	}else if(rslt==1){
          		var dtupo=data['dtupo'];
              var typenm=dtupo['typenm'];
          		var dtupqyqqno=dtupo['dtupqyqqno'];
          		var dtupqyqqpw=dtupo['dtupqyqqpw'];
          		var str="<b style='color:#f00'>"+qybscstwenxintishi+"</b><br><br><table class='table  table-striped  table-bordered table-hover'><tr><td>类型<td>"+typenm+"</td></tr><tr><td>帐号</td><td>"+dtupqyqqno+"</td></tr><tr><td>密码</td><td>"+dtupqyqqpw+"</td></tr></table>";
                
                $('#jieguoI').html(str);
          	}else if(rslt==2){
          		msg('未找到您的支付宝交易号，请与管理员核实！');return;
          	}else if(rslt==3){
              msg('该支付宝账号已经提取过了！');return;
            }else if(rslt==4){
              msg('应缴金额'+data['yjmoney']+'与实缴金额'+data['sjmoney']+'不匹配！');return;
            }

            console.log("success");
          },
          'error':function() {
            console.log("error");
          }
      });
	    
	})


  $('#getnopwbyalipaynoandqqno').click(function(){ 
    
      
      var obj=new Object();
      var alipayno=$.trim($('#alipaynoII').val());
      var qqno=$.trim($('#qqnoII').val());
      
      if(alipayno==''){alert('支付宝交易号不能为空！');return;}
      if(qqno==''){alert('QQ号不能为空！');return;}

      $('#jieguo').html('');
      $('#loading').trigger('click');
      obj['alipayno']=alipayno;
      obj['qqno']=qqno;
      
      $('.jieguo').html('');

      $.ajax({
          'type': 'GET',
          'url':dogetnopwbyalipaynoandqqno,
          'async':false,  
          'contentType': 'application/json',
          'data': obj,
          'dataType': 'json',
          'success': function(data) {
            $('#loading_cancel').trigger('click');
            var rslt=data['rslt'];
            if(rslt==0){
              msg('未找到数据，请再核实下您的交易号和QQ号！');return;
            }else if(rslt==1){
              var dtupo=data['dtupo'];
              var typenm=dtupo['typenm'];
              var dtupqyqqno=dtupo['dtupqyqqno'];
              var dtupqyqqpw=dtupo['dtupqyqqpw'];
              var str="<b style='color:#f00'>"+qybscstwenxintishi+"</b><br><br><table class='table  table-striped  table-bordered table-hover'><tr><td>类型<td>"+typenm+"</td></tr><tr><td>帐号</td><td>"+dtupqyqqno+"</td></tr><tr><td>密码</td><td>"+dtupqyqqpw+"</td></tr></table>";

                $('#jieguoII').html(str);
            }

            console.log("success");
          },
          'error':function() {
            console.log("error");
          }
      });
      
  })
})
</script>

